package Test;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

class  Numbers{
    int a;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Numbers numbers = (Numbers) o;
        return a == numbers.a;


    }

    @Override
    public int hashCode() {
        return Objects.hash(a);
    }
}
public class TestDemo14 {
    public static void main(String[] args) {
        HashMap<String,String> hashMap = new HashMap<>();
        hashMap.put(null,null);
        System.out.println(hashMap.get(null));
        Hashtable<String,String> hashtable = new Hashtable<>();
        hashtable.put(null,"1");
        System.out.println(hashtable.get(null));
    }
    public static void main1(String[] args) throws InterruptedException {
        CountDownLatch countDownLatch = new CountDownLatch(10);
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 10; i > 0 ; i--) {
                    System.out.println(i);
                    try {
                        TimeUnit.SECONDS.sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    countDownLatch.countDown();
                }
            }
        }).start();
        countDownLatch.await();
        System.out.println("倒计时结束");
    }
}
